The Virtual File System Panel
Figure 1-8 shows the Virtual File System (VFS) panel of JBindery. You use this panel to specify a virtual directory when packaging your Java application as a standalone file.Figure 1-8 The Virtual File System panel
![]()
The virtual file system lets you package Java classes and any other information your Java application requires (such as images or sound clips) in one file. These items are stored as though they were in a file hierarchy, so the Java application can access them normally. For example, say you have a Java program that requires two class files,
Upper.class
andWorking.class
, and a JPEG imagephoto.jpg
contained in a folder calledImages
. Using the Virtual File System panel, you can include all of these files in one application file and preserve the file hierarchy as well. Figure 1-9 compares a virtual file system to a real one.
Figure 1-9 Real and virtual file systems
- Note
- The contents of a virtual file directory are stored in the data fork of the application file as an uncompressed read-only zip archive. For more information about data forks, see "Mac OS Resources" (page 20).
![]()
![]()
- The Root Directory field specifies the root of the file hierarchy you want to package. The default name is
$VFS
. To make sure that the proper classes can be found, you must include the same directory name as a file URL in the list of searchable class paths (as described in "The Classpath Panel" (page 8)).- The Copy Contents of Folder Hierarchy checkbox specifies the location of the files you want to package. You can drag a folder onto the box or choose one by clicking within the box and bringing up a selection dialog box. The folder you specify should be the root of the directory hierarchy you want to include. After packaging, the root directory of the virtual file system has the name you specified in the Root Directory field.
- The Expand .Zip Files in Place checkbox specifies whether you want to extract Java classes from zip files when packaging them in the application. For example, say you have a zip file
Airline.zip
that containsFirst.class
andEconomy.class
. If you don't specify expanding the zip file, the packaged application will only containAirline.zip
. Otherwise, JBindery extracts the Java classes and placesFirst.class
andEconomy.class
in the packaged application.If your class files have names longer than the 32 characters allowed by the Mac OS, you can bypass this limitation by storing them in a zip archive and accessing them through the virtual file system.